package com.kvest.fragmentsfinaltest.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.kvest.fragmentsfinaltest.R;

/**
 * Created with IntelliJ IDEA.
 * User: Kvest
 * Date: 24.03.13
 * Time: 16:58
 * To change this template use File | Settings | File Templates.
 */
public class SimpleFragment extends Fragment {
    private TextView log;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.simple_fragment_layout, null);
        log = (TextView)view.findViewById(R.id.log_tv);

        return view;
    }

    @Override
    public void onActivityCreated(Bundle savedState) {
        super.onActivityCreated(savedState);

        log("Activity created");
    }

    private void log(String text) {
        if (log != null) {
            log.append(text + "\n");
        }
    }
}
